<?php
/**
 +---------------------------------------<br/>
 * 控制器:首页导航<br/>
 +---------------------------------------
 * @category membership
 * @package web.front.action
 * @author skygreen skygreen2001@gmail.com
 */
class Action_Index extends Action
{
    /**
     * 首页:网站所有页面列表
     */
    public function index()
    {
        $store_id = HttpSession::get("store_id");
        $usreid = HttpSession::get("userid");
        if (!$usreid) {
            $this->redirect("auth","login");
            return;
        }
        $this->loadCss("resources/css/index.css");
        $this->loadJs("js/index.js");
        $this->view->set("site_name","消费卡会员系统");
    }


    public function entry()
    {
        $store_id = HttpSession::get("store_id");
        $usreid = HttpSession::get("userid");
        if (!$usreid) {
            $this->redirect("auth","login");
            return;
        }
        if ($_POST) {
            $user_id = isset($_POST['user_id'])?$_POST['user_id']:"";
            HttpSession::set("user_id",$user_id);
            $result = UtilApi::getMember($user_id);
            if($result->code == "A00006"){
                HttpSession::set("user_id",$user_id);
                $this->redirect("api","kzf");
                exit;
            }
        }
        $this->loadCss("resources/css/entry.css");
        $this->loadCss("resources/css/msg.css");
        $this->loadJs("js/entry.js");
        $this->loadJs("js/msg.js");

    }

    public function kjh(){
        $usreid = HttpSession::get("userid");
        if (!$usreid) {
            $this->redirect("auth","login");
            return;
        }
        $this->loadCss("resources/css/indexkjh.css");
        $this->loadCss("resources/css/msg.css");
        $this->loadCss("resources/css/ui.thme.css");
        $this->loadJs("js/jquery.ui.core.js");
        $this->loadJs("js/jquery.ui.datepicker.js");
        $this->loadJs("js/msg.js");
        $this->loadJs("js/kjh.js");
        $card = isset($_GET['card'])?$_GET['card']:"";
        $store_id = HttpSession::get("store_id");
        $this->view->set("site_name","卡激活");
        $this->view->set("card",$card);
        $this->view->set("store_id",$store_id);
    }
}

?>